Skip to content

UC secrets follow a renamed catalog or schema - #7381

Open
denik wants to merge 16 commits into
denik/models-renamefrom
denik/secrets-parent-rename
Open

denik wants to merge 16 commits into
denik/models-renamefrom
denik/secrets-parent-rename

Conversation

@denik

@denik denik commented Nov 5, 2026 •

Copy link
Copy Markdown
Contributor

Changes

A UC secret in a renamed catalog or schema (schema_name: ${resources.schemas.<s>.name}) now follows its parent the way volumes do since #7343 and registered models do in #7379: with IDFromState, the framework re-keys it without a request (state_only). Before, it was recreated where the parent's rename moved it: the secret was deleted and created again.

UC cannot rename a secret, so its own name still recreates, even when it references a renamed resource's name: only its parent_id_fields (catalog_name, schema_name, from #7718) follow a parent. When the secret also has its own changes, the new DoUpdateWithID sends the update at the new path, and the framework records the new path first (#7379), so a failed update is retried there.

Stacked on #7379.

Tests

  • New secrets/recreate_in_renamed_schema (Cloud = true): rename the schema and the secret in one deploy. The secret is recreated, and the old one is deleted where the schema's rename moved it.
  • New secrets/parent_rename (Cloud = true): rename the schema (no request to the secret), then rename the catalog and change the secret's comment in one deploy (one PATCH at the new path). create_time stays the same and the final plan is a no-op.
  • New secrets/parent_rename_out_of_band (Cloud = true, Badness): a secret has no recorded id, so when its schema is renamed outside the bundle the plan creates it again and UC rejects the create. Same on main.
  • schemas/rename_with_model_and_secret (Cloud = true): the secret now follows the schema's rename too; the deploy sends only the schema's PATCH.
  • Unit test: a secret whose own name references the renamed schema is recreated, not re-keyed.
  • The test server now reports a missing secret and an existing one with UC's messages (Secret '<name>' does not exist., 409 ALREADY_EXISTS Secret '<name>' already exists; checked on AWS, Azure and GCP).

This pull request and its description were written by Isaac.

@github-actions

github-actions Bot commented Nov 5, 2026 •

Copy link
Copy Markdown
Contributor

Commit: 66ba15faf | Workflow run

Regression test report

Selected 19 changed tests (limit=20, 0 not selected)

46 tests: regression=37 unreleased=8 coverage=1 failing=0
test branch main (4c8b7a1) latest (v1.26.0)
TestAccept/bundle/migrate/auto/registered-model-rename/DMS= ✅ ❌ ❌
TestAccept/bundle/migrate/auto/volume-type-change/DMS= ✅ ✅ ✅
TestAccept/bundle/resources/catalogs/rename/DMS=/READPLAN= ✅ ❌ ❌
TestAccept/bundle/resources/catalogs/rename/DMS=/READPLAN=1 ✅ ❌ ❌
TestAccept/bundle/resources/catalogs/rename/DMS=true/READPLAN= ✅ ❌ ❌
TestAccept/bundle/resources/catalogs/rename/DMS=true/READPLAN=1 ✅ ❌ ❌
TestAccept/bundle/resources/grants/registered_model_change_name/DMS= ✅ ❌ ❌
TestAccept/bundle/resources/grants/registered_model_change_name/DMS=true ✅ ❌ ❌
TestAccept/bundle/resources/registered_models/basic/DMS= ✅ ❌ ❌
TestAccept/bundle/resources/registered_models/basic/DMS=true ✅ ❌ ❌
TestAccept/bundle/resources/registered_models/move_from_renamed_schema/DMS=/READPLAN= ✅ ✅ ❌
TestAccept/bundle/resources/registered_models/move_from_renamed_schema/DMS=/READPLAN=1 ✅ ✅ ❌
TestAccept/bundle/resources/registered_models/move_from_renamed_schema/DMS=true/READPLAN= ✅ ✅ ❌
TestAccept/bundle/resources/registered_models/move_from_renamed_schema/DMS=true/READPLAN=1 ✅ ✅ ❌
TestAccept/bundle/resources/registered_models/parent_rename_interrupted/DMS= ✅ ❌ ❌
TestAccept/bundle/resources/registered_models/parent_rename_out_of_band/DMS= ✅ ✅ ❌
TestAccept/bundle/resources/registered_models/parent_rename_out_of_band/DMS=true ✅ ✅ ❌
TestAccept/bundle/resources/registered_models/rename/DMS=/READPLAN= ✅ ❌ ❌
TestAccept/bundle/resources/registered_models/rename/DMS=/READPLAN=1 ✅ ❌ ❌
TestAccept/bundle/resources/registered_models/rename/DMS=true/READPLAN= ✅ ❌ ❌
TestAccept/bundle/resources/registered_models/rename/DMS=true/READPLAN=1 ✅ ❌ ❌
TestAccept/bundle/resources/registered_models/rename_catalog_and_schema/DMS=/READPLAN= ✅ ❌ ❌
TestAccept/bundle/resources/registered_models/rename_catalog_and_schema/DMS=/READPLAN=1 ✅ ❌ ❌
TestAccept/bundle/resources/registered_models/rename_catalog_and_schema/DMS=true/READPLAN= ✅ ❌ ❌
TestAccept/bundle/resources/registered_models/rename_catalog_and_schema/DMS=true/READPLAN=1 ✅ ❌ ❌
TestAccept/bundle/resources/registered_models/rename_to_existing_name/DMS= ✅ ❌ ❌
TestAccept/bundle/resources/registered_models/rename_to_existing_name/DMS=true ✅ ❌ ❌
TestAccept/bundle/resources/registered_models/rename_with_aliases/DMS= ✅ ❌ ❌
TestAccept/bundle/resources/registered_models/rename_with_aliases/DMS=true ✅ ❌ ❌
TestAccept/bundle/resources/schemas/rename_interrupted/DMS= ✅ ❌ ❌
TestAccept/bundle/resources/schemas/rename_referenced_by_name/DMS= ✅ ❌ ❌
TestAccept/bundle/resources/schemas/rename_referenced_by_name/DMS=true ✅ ❌ ❌
TestAccept/bundle/resources/schemas/rename_then_change/DMS= ✅ ❌ ❌
TestAccept/bundle/resources/schemas/rename_then_change/DMS=true ✅ ❌ ❌
TestAccept/bundle/resources/schemas/rename_with_model_and_secret/DMS= ✅ ❌ ❌
TestAccept/bundle/resources/schemas/rename_with_model_and_secret/DMS=true ✅ ❌ ❌
TestAccept/bundle/resources/secrets/parent_rename/DMS=/READPLAN= ✅ ❌ ❌
TestAccept/bundle/resources/secrets/parent_rename/DMS=/READPLAN=1 ✅ ❌ ❌
TestAccept/bundle/resources/secrets/parent_rename/DMS=true/READPLAN= ✅ ❌ ❌
TestAccept/bundle/resources/secrets/parent_rename/DMS=true/READPLAN=1 ✅ ❌ ❌
TestAccept/bundle/resources/secrets/parent_rename_out_of_band/DMS= ✅ ✅ ❌
TestAccept/bundle/resources/secrets/parent_rename_out_of_band/DMS=true ✅ ✅ ❌
TestAccept/bundle/resources/secrets/recreate_in_renamed_schema/DMS=/READPLAN= ✅ ❌ ❌
TestAccept/bundle/resources/secrets/recreate_in_renamed_schema/DMS=/READPLAN=1 ✅ ❌ ❌
TestAccept/bundle/resources/secrets/recreate_in_renamed_schema/DMS=true/READPLAN= ✅ ❌ ❌
TestAccept/bundle/resources/secrets/recreate_in_renamed_schema/DMS=true/READPLAN=1 ✅ ❌ ❌
TestAccept/bundle/migrate/auto/registered-model-rename/DMS=: branch ✅ | main (4c8b7a1) ❌ | latest (v1.26.0) ❌

main (4c8b7a1):

acceptance_test.go:1380: Diff:
        --- bundle/migrate/auto/registered-model-rename/output.txt
        +++ /tmp/TestAcceptbundlemigrateautoregistered-model-renameDMS=1767339636/002/output.txt
        @@ -6,15 +6,16 @@
         === Rename the model (an updatable id field) and deploy on direct
         
         >>> DATABRICKS_BUNDLE_ENGINE=direct [CLI] bundle deploy
        -Warn: migration to direct: registered_models.my_model: name differs between config ("themodel-[UNIQUE_NAME]-renamed") and terraform state ("themodel-[UNIQUE_NAME]"); this resource will be renamed.
        +Warn: migration to direct: registered_models.my_model: name differs between config ("themodel-[UNIQUE_NAME]-renamed") and terraform state ("themodel-[UNIQUE_NAME]"); this resource will be recreated.
         Notice: migrating your bundle to direct deployment engine (https://github.com/databricks/cli/issues/6765).
         Uploading bundle files to /Workspace/Users/[USERNAME]/.bundle/[UNIQUE_NAME]/files...
         Migrated 2 resources to direct deployment engine.
        -Updated registered_models.my_model
        +Recreated registered_models.my_model
         Files: 2 uploaded, 0 deleted
        -Resources: 0 created, 1 changed, 0 deleted, 1 unchanged
        +Resources: 1 created, 0 changed, 1 deleted, 1 unchanged
         
         >>> print_migration_telemetry
        +direct_migrate_recreate_planned true
         direct_migrated_via_env true
         
         === Redeploy on direct: the model now matches config, so the plan is a clean no-op

latest (v1.26.0): same output as main (4c8b7a1)

TestAccept/bundle/resources/catalogs/rename/DMS=/READPLAN=: branch ✅ | main (4c8b7a1) ❌ | latest (v1.26.0) ❌

main (4c8b7a1):

acceptance_test.go:1380: Diff:
        --- bundle/resources/catalogs/rename/output.txt
        +++ /tmp/TestAcceptbundleresourcescatalogsrenameDMS=READPLAN=1138952707/002/output.txt
        @@ -79,6 +79,7 @@
             }
           },
           "resources.registered_models.model1": {
        +    "id": "test_catalog_renamed_[UNIQUE_NAME].myschema.mymodel",
             "depends_on": [
               {
                 "node": "resources.catalogs.catalog1",
        @@ -89,8 +90,7 @@
                 "label": "${resources.schemas.schema1.name}"
               }
             ],
        -    "action": "update_id",
        -    "state_only": true,
        +    "action": "recreate",
             "new_state": {
               "value": {
                 "catalog_name": "test_catalog_renamed_[UNIQUE_NAME]",
        @@ -108,8 +108,8 @@
             },
             "changes": {
               "catalog_name": {
        -        "action": "update_id",
        -        "reason": "parent_renamed",
        +        "action": "recreate",
        +        "reason": "id_field",
                 "old": "test_catalog_[UNIQUE_NAME]",
                 "new": "test_catalog_renamed_[UNIQUE_NAME]",
                 "remote": "test_catalog_[UNIQUE_NAME]"
        @@ -224,9 +224,10 @@
         
         >>> [CLI] bundle deploy
         Uploading bundle files to /Workspace/Users/[USERNAME]/.bundle/test-bundle-[UNIQUE_NAME]/default/files...
        +Recreated registered_models.model1
         Updated catalogs.catalog1
         Files: 1 uploaded, 0 deleted
        -Resources: 0 created, 1 changed, 0 deleted, 3 unchanged
        +Resources: 1 created, 1 changed, 1 deleted, 2 unchanged
         
         >>> print_requests.py //unity-catalog
         {
        @@ -238,6 +237,19 @@
             "new_name": "test_catalog_renamed_[UNIQUE_NAME]"
           }
         }
        +{
        +  "method": "DELETE",
        +  "path": "/api/2.1/unity-catalog/models/test_catalog_renamed_[UNIQUE_NAME].myschema.mymodel"
        +}
        +{
        +  "method": "POST",
        +  "path": "/api/2.1/unity-catalog/models",
        +  "body": {
        +    "catalog_name": "test_catalog_renamed_[UNIQUE_NAME]",
        +    "name": "mymodel",
        +    "schema_name": "myschema"
        +  }
        +}
         
         === The old catalog is gone and the schema, the volume and the model are under the new one, not recreated
         old catalog is gone
        @@ -260,7 +272,7 @@
         {
           "full_name": "test_catalog_renamed_[UNIQUE_NAME].myschema.mymodel",
           "catalog_name": "test_catalog_renamed_[UNIQUE_NAME]",
        -  "created_at": [MODEL_CREATED_AT]
        +  "created_at": [UNIX_TIME_MILLIS]
         }
         
         === The state tracks the new paths
        
    acceptance_test.go:1158: 
        LOG.destroy_requests: {
        LOG.destroy_requests:   "method": "DELETE",
        LOG.destroy_requests:   "path": "/api/2.1/unity-catalog/models/test_catalog_renamed_d4t6npduybepdo37jae2hj4kge.myschema.mymodel"
        LOG.destroy_requests: }
        LOG.destroy_requests: {
        LOG.destroy_requests:   "method": "DELETE",
        LOG.destroy_requests:   "path": "/api/2.1/unity-catalog/volumes/test_catalog_renamed_d4t6npduybepdo37jae2hj4kge.myschema.myvolume"
        LOG.destroy_requests: }
        LOG.destroy_requests: {
        LOG.destroy_requests:   "method": "DELETE",
        LOG.destroy_requests:   "path": "/api/2.1/unity-catalog/schemas/test_catalog_renamed_d4t6npduybepdo37jae2hj4kge.myschema",
        LOG.destroy_requests:   "q": {
        LOG.destroy_requests:     "force": "true"
        LOG.destroy_requests:   }
        LOG.destroy_requests: }
        LOG.destroy_requests: {
        LOG.destroy_requests:   "method": "DELETE",
        LOG.destroy_requests:   "path": "/api/2.1/unity-catalog/catalogs/test_catalog_renamed_d4t6npduybepdo37jae2hj4kge",
        LOG.destroy_requests:   "q": {
        LOG.destroy_requests:     "force": "true"
        LOG.destroy_requests:   }
        LOG.destroy_requests: }

latest (v1.26.0):

acceptance_test.go:1380: Diff:
        --- bundle/resources/catalogs/rename/output.txt
        +++ /tmp/TestAcceptbundleresourcescatalogsrenameDMS=READPLAN=2946313595/002/output.txt
        @@ -89,8 +89,7 @@
                 "label": "${resources.schemas.schema1.name}"
               }
             ],
        -    "action": "update_id",
        -    "state_only": true,
        +    "action": "recreate",
             "new_state": {
               "value": {
                 "catalog_name": "test_catalog_renamed_[UNIQUE_NAME]",
        @@ -108,8 +107,8 @@
             },
             "changes": {
               "catalog_name": {
        -        "action": "update_id",
        -        "reason": "parent_renamed",
        +        "action": "recreate",
        +        "reason": "id_field",
                 "old": "test_catalog_[UNIQUE_NAME]",
                 "new": "test_catalog_renamed_[UNIQUE_NAME]",
                 "remote": "test_catalog_[UNIQUE_NAME]"
        @@ -138,8 +137,7 @@
                 "label": "${resources.catalogs.catalog1.name}"
               }
             ],
        -    "action": "update_id",
        -    "state_only": true,
        +    "action": "recreate",
             "new_state": {
               "value": {
                 "catalog_name": "test_catalog_renamed_[UNIQUE_NAME]",
        @@ -157,17 +155,11 @@
             },
             "changes": {
               "catalog_name": {
        -        "action": "update_id",
        -        "reason": "parent_renamed",
        +        "action": "recreate",
        +        "reason": "id_field",
                 "old": "test_catalog_[UNIQUE_NAME]",
                 "new": "test_catalog_renamed_[UNIQUE_NAME]",
                 "remote": "test_catalog_[UNIQUE_NAME]"
        -      },
        -      "schema_id": {
        -        "action": "skip",
        -        "reason": "internal_id",
        -        "old": "[SCHEMA_ID]",
        -        "remote": "[SCHEMA_ID]"
               }
             }
           },
        @@ -182,8 +171,7 @@
                 "label": "${resources.schemas.schema1.name}"
               }
             ],
        -    "action": "update_id",
        -    "state_only": true,
        +    "action": "recreate",
             "new_state": {
               "value": {
                 "catalog_name": "test_catalog_renamed_[UNIQUE_NAME]",
        @@ -204,17 +192,11 @@
             },
             "changes": {
               "catalog_name": {
        -        "action": "update_id",
        -        "reason": "parent_renamed",
        +        "action": "recreate",
        +        "reason": "id_field",
                 "old": "test_catalog_[UNIQUE_NAME]",
                 "new": "test_catalog_renamed_[UNIQUE_NAME]",
                 "remote": "test_catalog_[UNIQUE_NAME]"
        -      },
        -      "volume_id": {
        -        "action": "skip",
        -        "reason": "internal_id",
        -        "old": "[VOLUME_ID]",
        -        "remote": "[VOLUME_ID]"
               }
             }
           }
        @@ -224,75 +203,21 @@
         
         >>> [CLI] bundle deploy
         Uploading bundle files to /Workspace/Users/[USERNAME]/.bundle/test-bundle-[UNIQUE_NAME]/default/files...
        -Updated catalogs.catalog1
        -Files: 1 uploaded, 0 deleted
        -Resources: 0 created, 1 changed, 0 deleted, 3 unchanged
         
        ->>> print_requests.py //unity-catalog
        -{
        -  "method": "PATCH",
        -  "path": "/api/2.1/unity-catalog/catalogs/test_catalog_[UNIQUE_NAME]",
        -  "body": {
        -    "comment": "",
        -    "custom_max_retention_hours": 0,
        -    "new_name": "test_catalog_renamed_[UNIQUE_NAME]"
        -  }
        -}
        +This action will result in the deletion or recreation of the following UC schemas. Any underlying data may be lost:
        +  recreate resources.schemas.schema1
         
        -=== The old catalog is gone and the schema, the volume and the model are under the new one, not recreated
        -old catalog is gone
        +This action will result in the deletion or recreation of the following volumes.
        +For managed volumes, the files stored in the volume are also deleted from your
        +cloud tenant within 30 days. For external volumes, the metadata about the volume
        +is removed from the catalog, but the underlying files are not deleted:
        +  recreate resources.volumes.volume1
        +Error: the deployment requires destructive actions, but the current console does not support prompting.
        +Deleting data assets such as schemas, pipelines, or volumes may cause permanent data loss and should be carefully reviewed.
        +To proceed, use --auto-approve after reviewing the plan above.
         
        ->>> [CLI] schemas get test_catalog_renamed_[UNIQUE_NAME].myschema
        -{
        -  "full_name": "test_catalog_renamed_[UNIQUE_NAME].myschema",
        -  "catalog_name": "test_catalog_renamed_[UNIQUE_NAME]",
        -  "schema_id": "[SCHEMA_ID]"
        -}
        +Files: 1 uploaded, 0 deleted
         
        ->>> [CLI] volumes read test_catalog_renamed_[UNIQUE_NAME].myschema.myvolume
        -{
        -  "full_name": "test_catalog_renamed_[UNIQUE_NAME].myschema.myvolume",
        -  "catalog_name": "test_catalog_renamed_[UNIQUE_NAME]",
        -  "volume_id": "[VOLUME_ID]"
        -}
        -
        ->>> [CLI] registered-models get test_catalog_renamed_[UNIQUE_NAME].myschema.mymodel
        -{
        -  "full_name": "test_catalog_renamed_[UNIQUE_NAME].myschema.mymodel",
        -  "catalog_name": "test_catalog_renamed_[UNIQUE_NAME]",
        -  "created_at": [MODEL_CREATED_AT]
        -}
        -
        -=== The state tracks the new paths
        -
        ->>> [CLI] bundle summary --output json
        -{
        -  "catalogs": {
        -    "catalog1": "test_catalog_renamed_[UNIQUE_NAME]"
        -  },
        -  "registered_models": {
        -    "model1": "test_catalog_renamed_[UNIQUE_NAME].myschema.mymodel"
        -  },
        -  "schemas": {
        -    "schema1": "test_catalog_renamed_[UNIQUE_NAME].myschema"
        -  },
        -  "volumes": {
        -    "volume1": "test_catalog_renamed_[UNIQUE_NAME].myschema.myvolume"
        -  }
        -}
        -
        -=== Redeploy is a no-op
        -
        ->>> [CLI] bundle plan
        -Plan: 0 to add, 0 to change, 0 to delete, 4 unchanged
        -
        ->>> [CLI] bundle deploy
        -Uploading bundle files to /Workspace/Users/[USERNAME]/.bundle/test-bundle-[UNIQUE_NAME]/default/files...
        -Files: 0 uploaded, 0 deleted
        -Resources: 0 created, 0 changed, 0 deleted, 4 unchanged
        -
        ->>> print_requests.py //unity-catalog
        -
         >>> [CLI] bundle destroy --auto-approve
         The following resources will be deleted:
           delete resources.catalogs.catalog1
        @@ -312,3 +233,5 @@
         All files and directories at the following location will be deleted: /Workspace/Users/[USERNAME]/.bundle/test-bundle-[UNIQUE_NAME]/default
         
         Destroy: 4 deleted
        +
        +Exit code: 1
        
    acceptance_test.go:1158: 
        LOG.destroy_requests: {
        LOG.destroy_requests:   "method": "DELETE",
        LOG.destroy_requests:   "path": "/api/2.1/unity-catalog/models/test_catalog_yz7ymiucyreb3pz3v37zq4hiuy.myschema.mymodel"
        LOG.destroy_requests: }
        LOG.destroy_requests: {
        LOG.destroy_requests:   "method": "DELETE",
        LOG.destroy_requests:   "path": "/api/2.1/unity-catalog/volumes/test_catalog_yz7ymiucyreb3pz3v37zq4hiuy.myschema.myvolume"
        LOG.destroy_requests: }
        LOG.destroy_requests: {
        LOG.destroy_requests:   "method": "DELETE",
        LOG.destroy_requests:   "path": "/api/2.1/unity-catalog/schemas/test_catalog_yz7ymiucyreb3pz3v37zq4hiuy.myschema",
        LOG.destroy_requests:   "q": {
        LOG.destroy_requests:     "force": "true"
        LOG.destroy_requests:   }
        LOG.destroy_requests: }
        LOG.destroy_requests: {
        LOG.destroy_requests:   "method": "DELETE",
        LOG.destroy_requests:   "path": "/api/2.1/unity-catalog/catalogs/test_catalog_yz7ymiucyreb3pz3v37zq4hiuy",
        LOG.destroy_requests:   "q": {
        LOG.destroy_requests:     "force": "true"
        LOG.destroy_requests:   }
... (1 more lines truncated, raise DATABRICKS_CLI_TEST_MAX_LOG to see more)
TestAccept/bundle/resources/catalogs/rename/DMS=/READPLAN=1: branch ✅ | main (4c8b7a1) ❌ | latest (v1.26.0) ❌

main (4c8b7a1):

acceptance_test.go:1380: Diff:
        --- bundle/resources/catalogs/rename/output.txt
        +++ /tmp/TestAcceptbundleresourcescatalogsrenameDMS=READPLAN=12388571446/002/output.txt
        @@ -79,6 +79,7 @@
             }
           },
           "resources.registered_models.model1": {
        +    "id": "test_catalog_renamed_[UNIQUE_NAME].myschema.mymodel",
             "depends_on": [
               {
                 "node": "resources.catalogs.catalog1",
        @@ -89,8 +90,7 @@
                 "label": "${resources.schemas.schema1.name}"
               }
             ],
        -    "action": "update_id",
        -    "state_only": true,
        +    "action": "recreate",
             "new_state": {
               "value": {
                 "catalog_name": "test_catalog_renamed_[UNIQUE_NAME]",
        @@ -108,8 +108,8 @@
             },
             "changes": {
               "catalog_name": {
        -        "action": "update_id",
        -        "reason": "parent_renamed",
        +        "action": "recreate",
        +        "reason": "id_field",
                 "old": "test_catalog_[UNIQUE_NAME]",
                 "new": "test_catalog_renamed_[UNIQUE_NAME]",
                 "remote": "test_catalog_[UNIQUE_NAME]"
        @@ -224,9 +224,10 @@
         
         >>> [CLI] bundle deploy
         Uploading bundle files to /Workspace/Users/[USERNAME]/.bundle/test-bundle-[UNIQUE_NAME]/default/files...
        +Recreated registered_models.model1
         Updated catalogs.catalog1
         Files: 1 uploaded, 0 deleted
        -Resources: 0 created, 1 changed, 0 deleted, 3 unchanged
        +Resources: 1 created, 1 changed, 1 deleted, 2 unchanged
         
         >>> print_requests.py //unity-catalog
         {
        @@ -238,6 +237,19 @@
             "new_name": "test_catalog_renamed_[UNIQUE_NAME]"
           }
         }
        +{
        +  "method": "DELETE",
        +  "path": "/api/2.1/unity-catalog/models/test_catalog_renamed_[UNIQUE_NAME].myschema.mymodel"
        +}
        +{
        +  "method": "POST",
        +  "path": "/api/2.1/unity-catalog/models",
        +  "body": {
        +    "catalog_name": "test_catalog_renamed_[UNIQUE_NAME]",
        +    "name": "mymodel",
        +    "schema_name": "myschema"
        +  }
        +}
         
         === The old catalog is gone and the schema, the volume and the model are under the new one, not recreated
         old catalog is gone
        @@ -260,7 +272,7 @@
         {
           "full_name": "test_catalog_renamed_[UNIQUE_NAME].myschema.mymodel",
           "catalog_name": "test_catalog_renamed_[UNIQUE_NAME]",
        -  "created_at": [MODEL_CREATED_AT]
        +  "created_at": [UNIX_TIME_MILLIS]
         }
         
         === The state tracks the new paths
        
    acceptance_test.go:1158: 
        LOG.destroy_requests: {
        LOG.destroy_requests:   "method": "DELETE",
        LOG.destroy_requests:   "path": "/api/2.1/unity-catalog/models/test_catalog_renamed_54cdnryt2rdxrdjwkkfxpmbpxe.myschema.mymodel"
        LOG.destroy_requests: }
        LOG.destroy_requests: {
        LOG.destroy_requests:   "method": "DELETE",
        LOG.destroy_requests:   "path": "/api/2.1/unity-catalog/volumes/test_catalog_renamed_54cdnryt2rdxrdjwkkfxpmbpxe.myschema.myvolume"
        LOG.destroy_requests: }
        LOG.destroy_requests: {
        LOG.destroy_requests:   "method": "DELETE",
        LOG.destroy_requests:   "path": "/api/2.1/unity-catalog/schemas/test_catalog_renamed_54cdnryt2rdxrdjwkkfxpmbpxe.myschema",
        LOG.destroy_requests:   "q": {
        LOG.destroy_requests:     "force": "true"
        LOG.destroy_requests:   }
        LOG.destroy_requests: }
        LOG.destroy_requests: {
        LOG.destroy_requests:   "method": "DELETE",
        LOG.destroy_requests:   "path": "/api/2.1/unity-catalog/catalogs/test_catalog_renamed_54cdnryt2rdxrdjwkkfxpmbpxe",
        LOG.destroy_requests:   "q": {
        LOG.destroy_requests:     "force": "true"
        LOG.destroy_requests:   }
        LOG.destroy_requests: }

latest (v1.26.0):

acceptance_test.go:1380: Diff:
        --- bundle/resources/catalogs/rename/output.txt
        +++ /tmp/TestAcceptbundleresourcescatalogsrenameDMS=READPLAN=12138338275/002/output.txt
        @@ -89,8 +89,7 @@
                 "label": "${resources.schemas.schema1.name}"
               }
             ],
        -    "action": "update_id",
        -    "state_only": true,
        +    "action": "recreate",
             "new_state": {
               "value": {
                 "catalog_name": "test_catalog_renamed_[UNIQUE_NAME]",
        @@ -108,8 +107,8 @@
             },
             "changes": {
               "catalog_name": {
        -        "action": "update_id",
        -        "reason": "parent_renamed",
        +        "action": "recreate",
        +        "reason": "id_field",
                 "old": "test_catalog_[UNIQUE_NAME]",
                 "new": "test_catalog_renamed_[UNIQUE_NAME]",
                 "remote": "test_catalog_[UNIQUE_NAME]"
        @@ -138,8 +137,7 @@
                 "label": "${resources.catalogs.catalog1.name}"
               }
             ],
        -    "action": "update_id",
        -    "state_only": true,
        +    "action": "recreate",
             "new_state": {
               "value": {
                 "catalog_name": "test_catalog_renamed_[UNIQUE_NAME]",
        @@ -157,17 +155,11 @@
             },
             "changes": {
               "catalog_name": {
        -        "action": "update_id",
        -        "reason": "parent_renamed",
        +        "action": "recreate",
        +        "reason": "id_field",
                 "old": "test_catalog_[UNIQUE_NAME]",
                 "new": "test_catalog_renamed_[UNIQUE_NAME]",
                 "remote": "test_catalog_[UNIQUE_NAME]"
        -      },
        -      "schema_id": {
        -        "action": "skip",
        -        "reason": "internal_id",
        -        "old": "[SCHEMA_ID]",
        -        "remote": "[SCHEMA_ID]"
               }
             }
           },
        @@ -182,8 +171,7 @@
                 "label": "${resources.schemas.schema1.name}"
               }
             ],
        -    "action": "update_id",
        -    "state_only": true,
        +    "action": "recreate",
             "new_state": {
               "value": {
                 "catalog_name": "test_catalog_renamed_[UNIQUE_NAME]",
        @@ -204,17 +192,11 @@
             },
             "changes": {
               "catalog_name": {
        -        "action": "update_id",
        -        "reason": "parent_renamed",
        +        "action": "recreate",
        +        "reason": "id_field",
                 "old": "test_catalog_[UNIQUE_NAME]",
                 "new": "test_catalog_renamed_[UNIQUE_NAME]",
                 "remote": "test_catalog_[UNIQUE_NAME]"
        -      },
        -      "volume_id": {
        -        "action": "skip",
        -        "reason": "internal_id",
        -        "old": "[VOLUME_ID]",
        -        "remote": "[VOLUME_ID]"
               }
             }
           }
        @@ -224,75 +203,21 @@
         
         >>> [CLI] bundle deploy
         Uploading bundle files to /Workspace/Users/[USERNAME]/.bundle/test-bundle-[UNIQUE_NAME]/default/files...
        -Updated catalogs.catalog1
        -Files: 1 uploaded, 0 deleted
        -Resources: 0 created, 1 changed, 0 deleted, 3 unchanged
         
        ->>> print_requests.py //unity-catalog
        -{
        -  "method": "PATCH",
        -  "path": "/api/2.1/unity-catalog/catalogs/test_catalog_[UNIQUE_NAME]",
        -  "body": {
        -    "comment": "",
        -    "custom_max_retention_hours": 0,
        -    "new_name": "test_catalog_renamed_[UNIQUE_NAME]"
        -  }
        -}
        +This action will result in the deletion or recreation of the following UC schemas. Any underlying data may be lost:
        +  recreate resources.schemas.schema1
         
        -=== The old catalog is gone and the schema, the volume and the model are under the new one, not recreated
        -old catalog is gone
        +This action will result in the deletion or recreation of the following volumes.
        +For managed volumes, the files stored in the volume are also deleted from your
        +cloud tenant within 30 days. For external volumes, the metadata about the volume
        +is removed from the catalog, but the underlying files are not deleted:
        +  recreate resources.volumes.volume1
        +Error: the deployment requires destructive actions, but the current console does not support prompting.
        +Deleting data assets such as schemas, pipelines, or volumes may cause permanent data loss and should be carefully reviewed.
        +To proceed, use --auto-approve after reviewing the plan above.
         
        ->>> [CLI] schemas get test_catalog_renamed_[UNIQUE_NAME].myschema
        -{
        -  "full_name": "test_catalog_renamed_[UNIQUE_NAME].myschema",
        -  "catalog_name": "test_catalog_renamed_[UNIQUE_NAME]",
        -  "schema_id": "[SCHEMA_ID]"
        -}
        +Files: 1 uploaded, 0 deleted
         
        ->>> [CLI] volumes read test_catalog_renamed_[UNIQUE_NAME].myschema.myvolume
        -{
        -  "full_name": "test_catalog_renamed_[UNIQUE_NAME].myschema.myvolume",
        -  "catalog_name": "test_catalog_renamed_[UNIQUE_NAME]",
        -  "volume_id": "[VOLUME_ID]"
        -}
        -
        ->>> [CLI] registered-models get test_catalog_renamed_[UNIQUE_NAME].myschema.mymodel
        -{
        -  "full_name": "test_catalog_renamed_[UNIQUE_NAME].myschema.mymodel",
        -  "catalog_name": "test_catalog_renamed_[UNIQUE_NAME]",
        -  "created_at": [MODEL_CREATED_AT]
        -}
        -
        -=== The state tracks the new paths
        -
        ->>> [CLI] bundle summary --output json
        -{
        -  "catalogs": {
        -    "catalog1": "test_catalog_renamed_[UNIQUE_NAME]"
        -  },
        -  "registered_models": {
        -    "model1": "test_catalog_renamed_[UNIQUE_NAME].myschema.mymodel"
        -  },
        -  "schemas": {
        -    "schema1": "test_catalog_renamed_[UNIQUE_NAME].myschema"
        -  },
        -  "volumes": {
        -    "volume1": "test_catalog_renamed_[UNIQUE_NAME].myschema.myvolume"
        -  }
        -}
        -
        -=== Redeploy is a no-op
        -
        ->>> [CLI] bundle plan
        -Plan: 0 to add, 0 to change, 0 to delete, 4 unchanged
        -
        ->>> [CLI] bundle deploy
        -Uploading bundle files to /Workspace/Users/[USERNAME]/.bundle/test-bundle-[UNIQUE_NAME]/default/files...
        -Files: 0 uploaded, 0 deleted
        -Resources: 0 created, 0 changed, 0 deleted, 4 unchanged
        -
        ->>> print_requests.py //unity-catalog
        -
         >>> [CLI] bundle destroy --auto-approve
         The following resources will be deleted:
           delete resources.catalogs.catalog1
        @@ -312,3 +233,5 @@
         All files and directories at the following location will be deleted: /Workspace/Users/[USERNAME]/.bundle/test-bundle-[UNIQUE_NAME]/default
         
         Destroy: 4 deleted
        +
        +Exit code: 1
        
    acceptance_test.go:1158: 
        LOG.destroy_requests: {
        LOG.destroy_requests:   "method": "DELETE",
        LOG.destroy_requests:   "path": "/api/2.1/unity-catalog/models/test_catalog_jitz7mhzxfeppjf2iha24bwamm.myschema.mymodel"
        LOG.destroy_requests: }
        LOG.destroy_requests: {
        LOG.destroy_requests:   "method": "DELETE",
        LOG.destroy_requests:   "path": "/api/2.1/unity-catalog/volumes/test_catalog_jitz7mhzxfeppjf2iha24bwamm.myschema.myvolume"
        LOG.destroy_requests: }
        LOG.destroy_requests: {
        LOG.destroy_requests:   "method": "DELETE",
        LOG.destroy_requests:   "path": "/api/2.1/unity-catalog/schemas/test_catalog_jitz7mhzxfeppjf2iha24bwamm.myschema",
        LOG.destroy_requests:   "q": {
        LOG.destroy_requests:     "force": "true"
        LOG.destroy_requests:   }
        LOG.destroy_requests: }
        LOG.destroy_requests: {
        LOG.destroy_requests:   "method": "DELETE",
        LOG.destroy_requests:   "path": "/api/2.1/unity-catalog/catalogs/test_catalog_jitz7mhzxfeppjf2iha24bwamm",
        LOG.destroy_requests:   "q": {
        LOG.destroy_requests:     "force": "true"
        LOG.destroy_requests:   }
... (1 more lines truncated, raise DATABRICKS_CLI_TEST_MAX_LOG to see more)
TestAccept/bundle/resources/catalogs/rename/DMS=true/READPLAN=: branch ✅ | main (4c8b7a1) ❌ | latest (v1.26.0) ❌

main (4c8b7a1):

acceptance_test.go:1380: Diff:
        --- bundle/resources/catalogs/rename/output.txt
        +++ /tmp/TestAcceptbundleresourcescatalogsrenameDMS=trueREADPLAN=3602297832/002/output.txt
        @@ -79,6 +79,7 @@
             }
           },
           "resources.registered_models.model1": {
        +    "id": "test_catalog_renamed_[UNIQUE_NAME].myschema.mymodel",
             "depends_on": [
               {
                 "node": "resources.catalogs.catalog1",
        @@ -89,8 +90,7 @@
                 "label": "${resources.schemas.schema1.name}"
               }
             ],
        -    "action": "update_id",
        -    "state_only": true,
        +    "action": "recreate",
             "new_state": {
               "value": {
                 "catalog_name": "test_catalog_renamed_[UNIQUE_NAME]",
        @@ -108,8 +108,8 @@
             },
             "changes": {
               "catalog_name": {
        -        "action": "update_id",
        -        "reason": "parent_renamed",
        +        "action": "recreate",
        +        "reason": "id_field",
                 "old": "test_catalog_[UNIQUE_NAME]",
                 "new": "test_catalog_renamed_[UNIQUE_NAME]",
                 "remote": "test_catalog_[UNIQUE_NAME]"
        @@ -224,9 +224,10 @@
         
         >>> [CLI] bundle deploy
         Uploading bundle files to /Workspace/Users/[USERNAME]/.bundle/test-bundle-[UNIQUE_NAME]/default/files...
        +Recreated registered_models.model1
         Updated catalogs.catalog1
         Files: 1 uploaded, 0 deleted
        -Resources: 0 created, 1 changed, 0 deleted, 3 unchanged
        +Resources: 1 created, 1 changed, 1 deleted, 2 unchanged
         
         >>> print_requests.py //unity-catalog
         {
        @@ -238,6 +237,19 @@
             "new_name": "test_catalog_renamed_[UNIQUE_NAME]"
           }
         }
        +{
        +  "method": "DELETE",
        +  "path": "/api/2.1/unity-catalog/models/test_catalog_renamed_[UNIQUE_NAME].myschema.mymodel"
        +}
        +{
        +  "method": "POST",
        +  "path": "/api/2.1/unity-catalog/models",
        +  "body": {
        +    "catalog_name": "test_catalog_renamed_[UNIQUE_NAME]",
        +    "name": "mymodel",
        +    "schema_name": "myschema"
        +  }
        +}
         
         === The old catalog is gone and the schema, the volume and the model are under the new one, not recreated
         old catalog is gone
        @@ -260,7 +272,7 @@
         {
           "full_name": "test_catalog_renamed_[UNIQUE_NAME].myschema.mymodel",
           "catalog_name": "test_catalog_renamed_[UNIQUE_NAME]",
        -  "created_at": [MODEL_CREATED_AT]
        +  "created_at": [UNIX_TIME_MILLIS]
         }
         
         === The state tracks the new paths
        
    acceptance_test.go:1158: 
        LOG.destroy_requests: {
        LOG.destroy_requests:   "method": "DELETE",
        LOG.destroy_requests:   "path": "/api/2.1/unity-catalog/volumes/test_catalog_renamed_c2c7bgf6vbdnrbk7p233wca6ni.myschema.myvolume"
        LOG.destroy_requests: }
        LOG.destroy_requests: {
        LOG.destroy_requests:   "method": "DELETE",
        LOG.destroy_requests:   "path": "/api/2.1/unity-catalog/models/test_catalog_renamed_c2c7bgf6vbdnrbk7p233wca6ni.myschema.mymodel"
        LOG.destroy_requests: }
        LOG.destroy_requests: {
        LOG.destroy_requests:   "method": "DELETE",
        LOG.destroy_requests:   "path": "/api/2.1/unity-catalog/schemas/test_catalog_renamed_c2c7bgf6vbdnrbk7p233wca6ni.myschema",
        LOG.destroy_requests:   "q": {
        LOG.destroy_requests:     "force": "true"
        LOG.destroy_requests:   }
        LOG.destroy_requests: }
        LOG.destroy_requests: {
        LOG.destroy_requests:   "method": "DELETE",
        LOG.destroy_requests:   "path": "/api/2.1/unity-catalog/catalogs/test_catalog_renamed_c2c7bgf6vbdnrbk7p233wca6ni",
        LOG.destroy_requests:   "q": {
        LOG.destroy_requests:     "force": "true"
        LOG.destroy_requests:   }
        LOG.destroy_requests: }

latest (v1.26.0):

acceptance_test.go:1380: Diff:
        --- bundle/resources/catalogs/rename/output.txt
        +++ /tmp/TestAcceptbundleresourcescatalogsrenameDMS=trueREADPLAN=4056302414/002/output.txt
        @@ -89,8 +89,7 @@
                 "label": "${resources.schemas.schema1.name}"
               }
             ],
        -    "action": "update_id",
        -    "state_only": true,
        +    "action": "recreate",
             "new_state": {
               "value": {
                 "catalog_name": "test_catalog_renamed_[UNIQUE_NAME]",
        @@ -108,8 +107,8 @@
             },
             "changes": {
               "catalog_name": {
        -        "action": "update_id",
        -        "reason": "parent_renamed",
        +        "action": "recreate",
        +        "reason": "id_field",
                 "old": "test_catalog_[UNIQUE_NAME]",
                 "new": "test_catalog_renamed_[UNIQUE_NAME]",
                 "remote": "test_catalog_[UNIQUE_NAME]"
        @@ -138,8 +137,7 @@
                 "label": "${resources.catalogs.catalog1.name}"
               }
             ],
        -    "action": "update_id",
        -    "state_only": true,
        +    "action": "recreate",
             "new_state": {
               "value": {
                 "catalog_name": "test_catalog_renamed_[UNIQUE_NAME]",
        @@ -157,17 +155,11 @@
             },
             "changes": {
               "catalog_name": {
        -        "action": "update_id",
        -        "reason": "parent_renamed",
        +        "action": "recreate",
        +        "reason": "id_field",
                 "old": "test_catalog_[UNIQUE_NAME]",
                 "new": "test_catalog_renamed_[UNIQUE_NAME]",
                 "remote": "test_catalog_[UNIQUE_NAME]"
        -      },
        -      "schema_id": {
        -        "action": "skip",
        -        "reason": "internal_id",
        -        "old": "[SCHEMA_ID]",
        -        "remote": "[SCHEMA_ID]"
               }
             }
           },
        @@ -182,8 +171,7 @@
                 "label": "${resources.schemas.schema1.name}"
               }
             ],
        -    "action": "update_id",
        -    "state_only": true,
        +    "action": "recreate",
             "new_state": {
               "value": {
                 "catalog_name": "test_catalog_renamed_[UNIQUE_NAME]",
        @@ -204,17 +192,11 @@
             },
             "changes": {
               "catalog_name": {
        -        "action": "update_id",
        -        "reason": "parent_renamed",
        +        "action": "recreate",
        +        "reason": "id_field",
                 "old": "test_catalog_[UNIQUE_NAME]",
                 "new": "test_catalog_renamed_[UNIQUE_NAME]",
                 "remote": "test_catalog_[UNIQUE_NAME]"
        -      },
        -      "volume_id": {
        -        "action": "skip",
        -        "reason": "internal_id",
        -        "old": "[VOLUME_ID]",
        -        "remote": "[VOLUME_ID]"
               }
             }
           }
        @@ -224,75 +203,21 @@
         
         >>> [CLI] bundle deploy
         Uploading bundle files to /Workspace/Users/[USERNAME]/.bundle/test-bundle-[UNIQUE_NAME]/default/files...
        -Updated catalogs.catalog1
        -Files: 1 uploaded, 0 deleted
        -Resources: 0 created, 1 changed, 0 deleted, 3 unchanged
         
        ->>> print_requests.py //unity-catalog
        -{
        -  "method": "PATCH",
        -  "path": "/api/2.1/unity-catalog/catalogs/test_catalog_[UNIQUE_NAME]",
        -  "body": {
        -    "comment": "",
        -    "custom_max_retention_hours": 0,
        -    "new_name": "test_catalog_renamed_[UNIQUE_NAME]"
        -  }
        -}
        +This action will result in the deletion or recreation of the following UC schemas. Any underlying data may be lost:
        +  recreate resources.schemas.schema1
         
        -=== The old catalog is gone and the schema, the volume and the model are under the new one, not recreated
        -old catalog is gone
        +This action will result in the deletion or recreation of the following volumes.
        +For managed volumes, the files stored in the volume are also deleted from your
        +cloud tenant within 30 days. For external volumes, the metadata about the volume
        +is removed from the catalog, but the underlying files are not deleted:
        +  recreate resources.volumes.volume1
        +Error: the deployment requires destructive actions, but the current console does not support prompting.
        +Deleting data assets such as schemas, pipelines, or volumes may cause permanent data loss and should be carefully reviewed.
        +To proceed, use --auto-approve after reviewing the plan above.
         
        ->>> [CLI] schemas get test_catalog_renamed_[UNIQUE_NAME].myschema
        -{
        -  "full_name": "test_catalog_renamed_[UNIQUE_NAME].myschema",
        -  "catalog_name": "test_catalog_renamed_[UNIQUE_NAME]",
        -  "schema_id": "[SCHEMA_ID]"
        -}
        +Files: 1 uploaded, 0 deleted
         
        ->>> [CLI] volumes read test_catalog_renamed_[UNIQUE_NAME].myschema.myvolume
        -{
        -  "full_name": "test_catalog_renamed_[UNIQUE_NAME].myschema.myvolume",
        -  "catalog_name": "test_catalog_renamed_[UNIQUE_NAME]",
        -  "volume_id": "[VOLUME_ID]"
        -}
        -
        ->>> [CLI] registered-models get test_catalog_renamed_[UNIQUE_NAME].myschema.mymodel
        -{
        -  "full_name": "test_catalog_renamed_[UNIQUE_NAME].myschema.mymodel",
        -  "catalog_name": "test_catalog_renamed_[UNIQUE_NAME]",
        -  "created_at": [MODEL_CREATED_AT]
        -}
        -
        -=== The state tracks the new paths
        -
        ->>> [CLI] bundle summary --output json
        -{
        -  "catalogs": {
        -    "catalog1": "test_catalog_renamed_[UNIQUE_NAME]"
        -  },
        -  "registered_models": {
        -    "model1": "test_catalog_renamed_[UNIQUE_NAME].myschema.mymodel"
        -  },
        -  "schemas": {
        -    "schema1": "test_catalog_renamed_[UNIQUE_NAME].myschema"
        -  },
        -  "volumes": {
        -    "volume1": "test_catalog_renamed_[UNIQUE_NAME].myschema.myvolume"
        -  }
        -}
        -
        -=== Redeploy is a no-op
        -
        ->>> [CLI] bundle plan
        -Plan: 0 to add, 0 to change, 0 to delete, 4 unchanged
        -
        ->>> [CLI] bundle deploy
        -Uploading bundle files to /Workspace/Users/[USERNAME]/.bundle/test-bundle-[UNIQUE_NAME]/default/files...
        -Files: 0 uploaded, 0 deleted
        -Resources: 0 created, 0 changed, 0 deleted, 4 unchanged
        -
        ->>> print_requests.py //unity-catalog
        -
         >>> [CLI] bundle destroy --auto-approve
         The following resources will be deleted:
           delete resources.catalogs.catalog1
        @@ -312,3 +233,5 @@
         All files and directories at the following location will be deleted: /Workspace/Users/[USERNAME]/.bundle/test-bundle-[UNIQUE_NAME]/default
         
         Destroy: 4 deleted
        +
        +Exit code: 1
        
    acceptance_test.go:1158: 
        LOG.destroy_requests: {
        LOG.destroy_requests:   "method": "DELETE",
        LOG.destroy_requests:   "path": "/api/2.1/unity-catalog/models/test_catalog_kp3hwizsanc6jduv2gpuiq65hi.myschema.mymodel"
        LOG.destroy_requests: }
        LOG.destroy_requests: {
        LOG.destroy_requests:   "method": "DELETE",
        LOG.destroy_requests:   "path": "/api/2.1/unity-catalog/volumes/test_catalog_kp3hwizsanc6jduv2gpuiq65hi.myschema.myvolume"
        LOG.destroy_requests: }
        LOG.destroy_requests: {
        LOG.destroy_requests:   "method": "DELETE",
        LOG.destroy_requests:   "path": "/api/2.1/unity-catalog/schemas/test_catalog_kp3hwizsanc6jduv2gpuiq65hi.myschema",
        LOG.destroy_requests:   "q": {
        LOG.destroy_requests:     "force": "true"
        LOG.destroy_requests:   }
        LOG.destroy_requests: }
        LOG.destroy_requests: {
        LOG.destroy_requests:   "method": "DELETE",
        LOG.destroy_requests:   "path": "/api/2.1/unity-catalog/catalogs/test_catalog_kp3hwizsanc6jduv2gpuiq65hi",
        LOG.destroy_requests:   "q": {
        LOG.destroy_requests:     "force": "true"
        LOG.destroy_requests:   }
... (1 more lines truncated, raise DATABRICKS_CLI_TEST_MAX_LOG to see more)
TestAccept/bundle/resources/catalogs/rename/DMS=true/READPLAN=1: branch ✅ | main (4c8b7a1) ❌ | latest (v1.26.0) ❌

main (4c8b7a1):

acceptance_test.go:1380: Diff:
        --- bundle/resources/catalogs/rename/output.txt
        +++ /tmp/TestAcceptbundleresourcescatalogsrenameDMS=trueREADPLAN=12577724328/002/output.txt
        @@ -79,6 +79,7 @@
             }
           },
           "resources.registered_models.model1": {
        +    "id": "test_catalog_renamed_[UNIQUE_NAME].myschema.mymodel",
             "depends_on": [
               {
                 "node": "resources.catalogs.catalog1",
        @@ -89,8 +90,7 @@
                 "label": "${resources.schemas.schema1.name}"
               }
             ],
        -    "action": "update_id",
        -    "state_only": true,
        +    "action": "recreate",
             "new_state": {
               "value": {
                 "catalog_name": "test_catalog_renamed_[UNIQUE_NAME]",
        @@ -108,8 +108,8 @@
             },
             "changes": {
               "catalog_name": {
        -        "action": "update_id",
        -        "reason": "parent_renamed",
        +        "action": "recreate",
        +        "reason": "id_field",
                 "old": "test_catalog_[UNIQUE_NAME]",
                 "new": "test_catalog_renamed_[UNIQUE_NAME]",
                 "remote": "test_catalog_[UNIQUE_NAME]"
        @@ -224,9 +224,10 @@
         
         >>> [CLI] bundle deploy
         Uploading bundle files to /Workspace/Users/[USERNAME]/.bundle/test-bundle-[UNIQUE_NAME]/default/files...
        +Recreated registered_models.model1
         Updated catalogs.catalog1
         Files: 1 uploaded, 0 deleted
        -Resources: 0 created, 1 changed, 0 deleted, 3 unchanged
        +Resources: 1 created, 1 changed, 1 deleted, 2 unchanged
         
         >>> print_requests.py //unity-catalog
         {
        @@ -238,6 +237,19 @@
             "new_name": "test_catalog_renamed_[UNIQUE_NAME]"
           }
         }
        +{
        +  "method": "DELETE",
        +  "path": "/api/2.1/unity-catalog/models/test_catalog_renamed_[UNIQUE_NAME].myschema.mymodel"
        +}
        +{
        +  "method": "POST",
        +  "path": "/api/2.1/unity-catalog/models",
        +  "body": {
        +    "catalog_name": "test_catalog_renamed_[UNIQUE_NAME]",
        +    "name": "mymodel",
        +    "schema_name": "myschema"
        +  }
        +}
         
         === The old catalog is gone and the schema, the volume and the model are under the new one, not recreated
         old catalog is gone
        @@ -260,7 +272,7 @@
         {
           "full_name": "test_catalog_renamed_[UNIQUE_NAME].myschema.mymodel",
           "catalog_name": "test_catalog_renamed_[UNIQUE_NAME]",
        -  "created_at": [MODEL_CREATED_AT]
        +  "created_at": [UNIX_TIME_MILLIS]
         }
         
         === The state tracks the new paths
        
    acceptance_test.go:1158: 
        LOG.destroy_requests: {
        LOG.destroy_requests:   "method": "DELETE",
        LOG.destroy_requests:   "path": "/api/2.1/unity-catalog/models/test_catalog_renamed_w4flilgpyfbubbdqccfot65f3u.myschema.mymodel"
        LOG.destroy_requests: }
        LOG.destroy_requests: {
        LOG.destroy_requests:   "method": "DELETE",
        LOG.destroy_requests:   "path": "/api/2.1/unity-catalog/volumes/test_catalog_renamed_w4flilgpyfbubbdqccfot65f3u.myschema.myvolume"
        LOG.destroy_requests: }
        LOG.destroy_requests: {
        LOG.destroy_requests:   "method": "DELETE",
        LOG.destroy_requests:   "path": "/api/2.1/unity-catalog/schemas/test_catalog_renamed_w4flilgpyfbubbdqccfot65f3u.myschema",
        LOG.destroy_requests:   "q": {
        LOG.destroy_requests:     "force": "true"
        LOG.destroy_requests:   }
        LOG.destroy_requests: }
        LOG.destroy_requests: {
        LOG.destroy_requests:   "method": "DELETE",
        LOG.destroy_requests:   "path": "/api/2.1/unity-catalog/catalogs/test_catalog_renamed_w4flilgpyfbubbdqccfot65f3u",
        LOG.destroy_requests:   "q": {
        LOG.destroy_requests:     "force": "true"
        LOG.destroy_requests:   }
        LOG.destroy_requests: }

latest (v1.26.0):

acceptance_test.go:1380: Diff:
        --- bundle/resources/catalogs/rename/output.txt
        +++ /tmp/TestAcceptbundleresourcescatalogsrenameDMS=trueREADPLAN=13838556946/002/output.txt
        @@ -89,8 +89,7 @@
                 "label": "${resources.schemas.schema1.name}"
               }
             ],
        -    "action": "update_id",
        -    "state_only": true,
        +    "action": "recreate",
             "new_state": {
               "value": {
                 "catalog_name": "test_catalog_renamed_[UNIQUE_NAME]",
        @@ -108,8 +107,8 @@
             },
             "changes": {
               "catalog_name": {
        -        "action": "update_id",
        -        "reason": "parent_renamed",
        +        "action": "recreate",
        +        "reason": "id_field",
                 "old": "test_catalog_[UNIQUE_NAME]",
                 "new": "test_catalog_renamed_[UNIQUE_NAME]",
                 "remote": "test_catalog_[UNIQUE_NAME]"
        @@ -138,8 +137,7 @@
                 "label": "${resources.catalogs.catalog1.name}"
               }
             ],
        -    "action": "update_id",
        -    "state_only": true,
        +    "action": "recreate",
             "new_state": {
               "value": {
                 "catalog_name": "test_catalog_renamed_[UNIQUE_NAME]",
        @@ -157,17 +155,11 @@
             },
             "changes": {
               "catalog_name": {
        -        "action": "update_id",
        -        "reason": "parent_renamed",
        +        "action": "recreate",
        +        "reason": "id_field",
                 "old": "test_catalog_[UNIQUE_NAME]",
                 "new": "test_catalog_renamed_[UNIQUE_NAME]",
                 "remote": "test_catalog_[UNIQUE_NAME]"
        -      },
        -      "schema_id": {
        -        "action": "skip",
        -        "reason": "internal_id",
        -        "old": "[SCHEMA_ID]",
        -        "remote": "[SCHEMA_ID]"
               }
             }
           },
        @@ -182,8 +171,7 @@
                 "label": "${resources.schemas.schema1.name}"
               }
             ],
        -    "action": "update_id",
        -    "state_only": true,
        +    "action": "recreate",
             "new_state": {
               "value": {
                 "catalog_name": "test_catalog_renamed_[UNIQUE_NAME]",
        @@ -204,17 +192,11 @@
             },
             "changes": {
               "catalog_name": {
        -        "action": "update_id",
        -        "reason": "parent_renamed",
        +        "action": "recreate",
        +        "reason": "id_field",
                 "old": "test_catalog_[UNIQUE_NAME]",
                 "new": "test_catalog_renamed_[UNIQUE_NAME]",
                 "remote": "test_catalog_[UNIQUE_NAME]"
        -      },
        -      "volume_id": {
        -        "action": "skip",
        -        "reason": "internal_id",
        -        "old": "[VOLUME_ID]",
        -        "remote": "[VOLUME_ID]"
               }
             }
           }
        @@ -224,75 +203,21 @@
         
         >>> [CLI] bundle deploy
         Uploading bundle files to /Workspace/Users/[USERNAME]/.bundle/test-bundle-[UNIQUE_NAME]/default/files...
        -Updated catalogs.catalog1
        -Files: 1 uploaded, 0 deleted
        -Resources: 0 created, 1 changed, 0 deleted, 3 unchanged
         
        ->>> print_requests.py //unity-catalog
        -{
        -  "method": "PATCH",
        -  "path": "/api/2.1/unity-catalog/catalogs/test_catalog_[UNIQUE_NAME]",
        -  "body": {
        -    "comment": "",
        -    "custom_max_retention_hours": 0,
        -    "new_name": "test_catalog_renamed_[UNIQUE_NAME]"
        -  }
        -}
        +This action will result in the deletion or recreation of the following UC schemas. Any underlying data may be lost:
        +  recreate resources.schemas.schema1
         
        -=== The old catalog is gone and the schema, the volume and the model are under the new one, not recreated
        -old catalog is gone
        +This action will result in the deletion or recreation of the following volumes.
        +For managed volumes, the files stored in the volume are also deleted from your
        +cloud tenant within 30 days. For external volumes, the metadata about the volume
        +is removed from the catalog, but the underlying files are not deleted:
        +  recreate resources.volumes.volume1
        +Error: the deployment requires destructive actions, but the current console does not support prompting.
        +Deleting data assets such as schemas, pipelines, or volumes may cause permanent data loss and should be carefully reviewed.
        +To proceed, use --auto-approve after reviewing the plan above.
         
        ->>> [CLI] schemas get test_catalog_renamed_[UNIQUE_NAME].myschema
        -{
        -  "full_name": "test_catalog_renamed_[UNIQUE_NAME].myschema",
        -  "catalog_name": "test_catalog_renamed_[UNIQUE_NAME]",
        -  "schema_id": "[SCHEMA_ID]"
        -}
        +Files: 1 uploaded, 0 deleted
         
        ->>> [CLI] volumes read test_catalog_renamed_[UNIQUE_NAME].myschema.myvolume
        -{
        -  "full_name": "test_catalog_renamed_[UNIQUE_NAME].myschema.myvolume",
        -  "catalog_name": "test_catalog_renamed_[UNIQUE_NAME]",
        -  "volume_id": "[VOLUME_ID]"
        -}
        -
        ->>> [CLI] registered-models get test_catalog_renamed_[UNIQUE_NAME].myschema.mymodel
        -{
        -  "full_name": "test_catalog_renamed_[UNIQUE_NAME].myschema.mymodel",
        -  "catalog_name": "test_catalog_renamed_[UNIQUE_NAME]",
        -  "created_at": [MODEL_CREATED_AT]
        -}
        -
        -=== The state tracks the new paths
        -
        ->>> [CLI] bundle summary --output json
        -{
        -  "catalogs": {
        -    "catalog1": "test_catalog_renamed_[UNIQUE_NAME]"
        -  },
        -  "registered_models": {
        -    "model1": "test_catalog_renamed_[UNIQUE_NAME].myschema.mymodel"
        -  },
        -  "schemas": {
        -    "schema1": "test_catalog_renamed_[UNIQUE_NAME].myschema"
        -  },
        -  "volumes": {
        -    "volume1": "test_catalog_renamed_[UNIQUE_NAME].myschema.myvolume"
        -  }
        -}
        -
        -=== Redeploy is a no-op
        -
        ->>> [CLI] bundle plan
        -Plan: 0 to add, 0 to change, 0 to delete, 4 unchanged
        -
        ->>> [CLI] bundle deploy
        -Uploading bundle files to /Workspace/Users/[USERNAME]/.bundle/test-bundle-[UNIQUE_NAME]/default/files...
        -Files: 0 uploaded, 0 deleted
        -Resources: 0 created, 0 changed, 0 deleted, 4 unchanged
        -
        ->>> print_requests.py //unity-catalog
        -
         >>> [CLI] bundle destroy --auto-approve
         The following resources will be deleted:
           delete resources.catalogs.catalog1
        @@ -312,3 +233,5 @@
         All files and directories at the following location will be deleted: /Workspace/Users/[USERNAME]/.bundle/test-bundle-[UNIQUE_NAME]/default
         
         Destroy: 4 deleted
        +
        +Exit code: 1
        
    acceptance_test.go:1158: 
        LOG.destroy_requests: {
        LOG.destroy_requests:   "method": "DELETE",
        LOG.destroy_requests:   "path": "/api/2.1/unity-catalog/models/test_catalog_smmtucf4vbadjo4rlg77h5ka3i.myschema.mymodel"
        LOG.destroy_requests: }
        LOG.destroy_requests: {
        LOG.destroy_requests:   "method": "DELETE",
        LOG.destroy_requests:   "path": "/api/2.1/unity-catalog/volumes/test_catalog_smmtucf4vbadjo4rlg77h5ka3i.myschema.myvolume"
        LOG.destroy_requests: }
        LOG.destroy_requests: {
        LOG.destroy_requests:   "method": "DELETE",
        LOG.destroy_requests:   "path": "/api/2.1/unity-catalog/schemas/test_catalog_smmtucf4vbadjo4rlg77h5ka3i.myschema",
        LOG.destroy_requests:   "q": {
        LOG.destroy_requests:     "force": "true"
        LOG.destroy_requests:   }
        LOG.destroy_requests: }
        LOG.destroy_requests: {
        LOG.destroy_requests:   "method": "DELETE",
        LOG.destroy_requests:   "path": "/api/2.1/unity-catalog/catalogs/test_catalog_smmtucf4vbadjo4rlg77h5ka3i",
        LOG.destroy_requests:   "q": {
        LOG.destroy_requests:     "force": "true"
        LOG.destroy_requests:   }
... (1 more lines truncated, raise DATABRICKS_CLI_TEST_MAX_LOG to see more)

40 more failure details omitted, see the full report in the run.

@eng-dev-ecosystem-bot

eng-dev-ecosystem-bot commented Nov 5, 2026 •

Copy link
Copy Markdown
Collaborator

✅ Integration test report

Commit: 66ba15f

Run: 44093835479

Env 🔄​flaky 💚​RECOVERED ✅​pass 🙈​skip Time
🔄​ aws linux-2core-8gb 1 1 323 20 25:55
🔄​ aws-windows-latest-4core-16gb 1 1 325 18 27:41
💚​ azure linux-2core-8gb 1 323 20 23:18
🔄​ azure-windows-latest-4core-16gb 3 323 18 32:20
🔄​ gcp linux-2core-8gb 3 322 20 33:50
🔄​ gcp-windows-latest-4core-16gb 3 324 18 31:02
8 interesting tests: 8 flaky
Test Name aws linux-2core-8gb aws-windows-latest-4core-16gb azure linux-2core-8gb azure-windows-latest-4core-16gb gcp linux-2core-8gb gcp-windows-latest-4core-16gb
🔄​ TestAccept 💚​R 💚​R 💚​R 🔄​f 🔄​f 🔄​f
🔄​ TestAccept/bundle/resources/registered_models/move_from_renamed_schema ✅​p ✅​p ✅​p ✅​p ✅​p 🔄​f
🔄​ TestAccept/bundle/resources/registered_models/move_from_renamed_schema/DMS=/READPLAN= ✅​p ✅​p ✅​p ✅​p ✅​p 🔄​f
🔄​ TestAccept/bundle/resources/schemas/rename_then_change ✅​p ✅​p ✅​p ✅​p 🔄​f ✅​p
🔄​ TestAccept/bundle/resources/schemas/rename_then_change/DMS=true ✅​p ✅​p ✅​p ✅​p 🔄​f ✅​p
🔄​ TestAccept/bundle/resources/secrets/parent_rename ✅​p ✅​p ✅​p 🔄​f ✅​p ✅​p
🔄​ TestAccept/bundle/resources/secrets/parent_rename/DMS=true/READPLAN=1 ✅​p ✅​p ✅​p 🔄​f ✅​p ✅​p
🔄​ TestSyncIncrementalSyncFileToPythonNotebook 🔄​f 🔄​f ✅​p ✅​p ✅​p ✅​p
Top 50 slowest tests (at least 2 minutes):
duration env testname
11:26 aws-windows-latest-4core-16gb TestAccept/bundle/resources/schemas/rename_then_change/DMS=
8:27 gcp-windows-latest-4core-16gb TestAccept/bundle/resources/schemas/rename_then_change/DMS=true
8:16 aws linux-2core-8gb TestAccept/bundle/resources/schemas/rename_then_change/DMS=
7:07 gcp-windows-latest-4core-16gb TestAccept/bundle/resources/registered_models/basic/DMS=true
7:07 azure linux-2core-8gb TestAccept/bundle/resources/schemas/rename_then_change/DMS=
6:59 aws-windows-latest-4core-16gb TestAccept/bundle/resources/schemas/rename_then_change/DMS=true
6:57 gcp linux-2core-8gb TestAccept/bundle/resources/schemas/rename_then_change/DMS=true
6:54 gcp-windows-latest-4core-16gb TestAccept/bundle/resources/schemas/rename_then_change/DMS=
6:37 azure-windows-latest-4core-16gb TestAccept/bundle/resources/registered_models/basic/DMS=
6:31 aws linux-2core-8gb TestAccept/bundle/resources/schemas/rename_then_change/DMS=true
6:27 azure linux-2core-8gb TestAccept/bundle/resources/schemas/rename_then_change/DMS=true
6:20 azure-windows-latest-4core-16gb TestAccept/bundle/resources/schemas/rename_then_change/DMS=
6:14 gcp linux-2core-8gb TestAccept/bundle/resources/schemas/rename_then_change/DMS=
6:03 gcp-windows-latest-4core-16gb TestAccept/bundle/resources/registered_models/basic/DMS=
5:20 gcp linux-2core-8gb TestAccept/bundle/resources/registered_models/basic/DMS=true
5:18 gcp-windows-latest-4core-16gb TestAccept/bundle/resources/secrets/parent_rename/DMS=true/READPLAN=
5:09 azure linux-2core-8gb TestAccept/bundle/resources/registered_models/basic/DMS=true
4:46 azure-windows-latest-4core-16gb TestAccept/bundle/resources/registered_models/basic/DMS=true
4:36 azure-windows-latest-4core-16gb TestAccept/bundle/resources/secrets/parent_rename_out_of_band/DMS=
4:30 azure-windows-latest-4core-16gb TestAccept/bundle/resources/catalogs/rename/DMS=true/READPLAN=1
4:18 aws linux-2core-8gb TestAccept/bundle/resources/registered_models/basic/DMS=
4:14 azure-windows-latest-4core-16gb TestAccept/bundle/resources/schemas/rename_then_change/DMS=true
4:07 aws-windows-latest-4core-16gb TestAccept/bundle/resources/registered_models/basic/DMS=
4:01 gcp linux-2core-8gb TestAccept/bundle/resources/registered_models/rename/DMS=/READPLAN=
4:00 aws-windows-latest-4core-16gb TestAccept/bundle/resources/registered_models/basic/DMS=true
3:36 aws-windows-latest-4core-16gb TestAccept
3:36 aws linux-2core-8gb TestAccept/bundle/resources/registered_models/rename_catalog_and_schema/DMS=true/READPLAN=1
3:28 azure linux-2core-8gb TestAccept/bundle/resources/schemas/rename_with_model_and_secret/DMS=true
3:28 gcp linux-2core-8gb TestAccept/bundle/resources/registered_models/move_from_renamed_schema/DMS=/READPLAN=1
3:27 azure linux-2core-8gb TestAccept/bundle/resources/secrets/parent_rename/DMS=true/READPLAN=
3:24 gcp-windows-latest-4core-16gb TestAccept/bundle/resources/registered_models/move_from_renamed_schema/DMS=/READPLAN=1
3:22 azure-windows-latest-4core-16gb TestAccept/bundle/resources/secrets/parent_rename/DMS=/READPLAN=1
3:18 azure linux-2core-8gb TestAccept/bundle/resources/registered_models/move_from_renamed_schema/DMS=/READPLAN=1
3:17 aws-windows-latest-4core-16gb TestAccept/bundle/resources/registered_models/rename/DMS=true/READPLAN=
3:16 aws linux-2core-8gb TestAccept/bundle/resources/registered_models/move_from_renamed_schema/DMS=true/READPLAN=1
3:12 aws linux-2core-8gb TestAccept/bundle/resources/secrets/parent_rename/DMS=/READPLAN=
3:10 gcp-windows-latest-4core-16gb TestAccept/bundle/resources/registered_models/parent_rename_out_of_band/DMS=true
3:08 gcp linux-2core-8gb TestAccept/bundle/resources/catalogs/rename/DMS=true/READPLAN=
3:07 gcp linux-2core-8gb TestAccept/bundle/resources/secrets/parent_rename/DMS=/READPLAN=1
3:06 aws linux-2core-8gb TestAccept/bundle/resources/registered_models/basic/DMS=true
3:05 gcp-windows-latest-4core-16gb TestAccept/bundle/resources/secrets/recreate_in_renamed_schema/DMS=true/READPLAN=
3:05 gcp linux-2core-8gb TestAccept/bundle/resources/catalogs/rename/DMS=true/READPLAN=1
3:04 aws-windows-latest-4core-16gb TestAccept/bundle/resources/registered_models/rename/DMS=/READPLAN=
3:01 gcp-windows-latest-4core-16gb TestAccept/bundle/resources/registered_models/rename_to_existing_name/DMS=true
3:01 gcp-windows-latest-4core-16gb TestFilerRecursiveDelete/workspace_files_extensions
3:01 azure-windows-latest-4core-16gb TestAccept/bundle/resources/catalogs/rename/DMS=/READPLAN=
2:58 gcp linux-2core-8gb TestAccept/bundle/resources/secrets/recreate_in_renamed_schema/DMS=/READPLAN=1
2:58 aws-windows-latest-4core-16gb TestAccept/bundle/resources/secrets/parent_rename/DMS=true/READPLAN=
2:56 aws-windows-latest-4core-16gb TestAccept/bundle/resources/secrets/parent_rename/DMS=/READPLAN=
2:54 aws linux-2core-8gb TestAccept/bundle/resources/registered_models/rename_to_existing_name/DMS=

@denik
denik force-pushed the denik/secrets-parent-rename branch from 344a6c9 to 24b12d9 Compare November 6, 2026 11:21
@denik
denik force-pushed the denik/secrets-parent-rename branch from 24b12d9 to 35b8737 Compare November 6, 2026 11:58
@denik
denik force-pushed the denik/secrets-parent-rename branch from 35b8737 to 5bd3516 Compare November 6, 2026 12:25
@denik
denik force-pushed the denik/secrets-parent-rename branch from 5bd3516 to a333a4b Compare November 9, 2026 10:06
@denik
denik force-pushed the denik/secrets-parent-rename branch from a333a4b to 4ccf5ab Compare November 9, 2026 10:17
@denik
denik force-pushed the denik/secrets-parent-rename branch from 4ccf5ab to cdc56bf Compare November 9, 2026 11:52
@denik
denik force-pushed the denik/secrets-parent-rename branch from cdc56bf to 0d1ef07 Compare November 9, 2026 13:12
@denik
denik force-pushed the denik/secrets-parent-rename branch from 0d1ef07 to d16b7c2 Compare November 9, 2026 14:52
@denik
denik added this pull request to stack #7411 November 9, 2026 14:54
@denik
denik force-pushed the denik/secrets-parent-rename branch from d16b7c2 to 5e37c6e Compare November 9, 2026 14:59
@github-actions github-actions Bot added the DABs DABs related issues label Nov 9, 2026
@denik
denik force-pushed the denik/secrets-parent-rename branch from 5e37c6e to 2957d38 Compare November 9, 2026 15:11
@denik
denik force-pushed the denik/secrets-parent-rename branch from 2957d38 to ce6daec Compare November 9, 2026 15:43
@denik
denik force-pushed the denik/secrets-parent-rename branch from ce6daec to 2b74f07 Compare November 9, 2026 20:33
@denik
denik requested a review from andrewnester November 16, 2026 11:49

@simonfaltum simonfaltum left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤖 Automated review from simonfaltum's review agent (pr-review skill) at b667ba5. Each finding was verified against the code; simonfaltum may follow up.

Not approving yet: 1 blocking issue(s), tagged [blocking].

This PR lets a UC secret follow a renamed catalog or schema: it lists the secret's ID fields as provided ID fields and adds DoUpdateWithID. The common case works and is well tested, including on real workspaces, and CI is green. Because the secret's own name is now a provided ID field, a name that references another resource's renamable name is re-keyed in state instead of recreated. State then points at a secret that doesn't exist, which I reproduced on the test server. Two smaller points: a failed update after the parent rename leaves the bundle stuck on 409, and the adapter.go hunk never runs for secrets, so it can be dropped.

Comment on lines +8 to +9
- field: name
reason: id_field

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[blocking] Listing the secret's own name in provided_id_fields lets followsParentRename treat any pure reference in name as following a parent rename. parentRenames keys on whatever field holds the reference, and followsParentRename doesn't check which field it is.

Example: name: ${resources.schemas.app.name} in a secret that lives in another schema (schema_name: shared). When app is renamed from app_a to app_b, the plan shows no change for the secret and marks it update_id/parent_renamed with state_only. The deploy records main.shared.app_b, which doesn't exist; UC still has main.shared.app_a. The next plan then wants to create it. If the value or comment also changes in that deploy, DoUpdateWithID PATCHes main.shared.app_b and the deploy fails with 404. I reproduced both against the test server. Before this PR the same config planned a recreate.

Suggested fix: keep name out of the parent-rename path. Either drop it from provided_id_fields (the generated recreate_on_changes still recreates on it), or make followsParentRename consider only the fields that name the parent. Please also add a test with name: ${resources.schemas.x.name}.

Related, already in the base branch: addParentMoves protects a resource's own name only when it is an updatable_id_field. For this same config, the recreate deletes at main.shared.app_b, gets 404, and leaves main.shared.app_a orphaned. The same fix in both places would close that too.

Optionally, DoUpdateWithID could return an internal error when the name in id differs from state.Name. Then a misrouted name change fails clearly instead of PATCHing a path that doesn't exist.

Comment on lines +115 to +119
func (r *ResourceSecret) DoUpdateWithID(ctx context.Context, _ string, state *catalog.Secret, entry *PlanEntry) (string, *catalog.Secret, error) {
newID := r.IDFromState(state)
remote, err := r.DoUpdate(ctx, newID, state, entry)
return newID, remote, err
}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nice to have] Once the schema's PATCH has moved the secret, a failure of the secret's PATCH at the new path leaves its state at the old ID. Secrets have no internal_id_field, so findMoved cannot find it there. Every later deploy reads the old ID, gets 404, plans a create, and fails with 409 RESOURCE_ALREADY_EXISTS, even after the cause is fixed. Any non-transient error triggers this: a permission error, or an expire_time the backend rejects.

I reproduced it on the test server: rename the schema, change comment, and make the PATCH return 403. Before this PR the same deploy went through recreate, and a failed create dropped the state, so the next deploy could recover. Registered models in #7379 share this gap.

Suggested fix: when an update_id only follows a parent rename, record the new ID before calling DoUpdateWithID, so a failed update is retried at the right path. Another option is to let the plan look at IDFromState when the recorded ID is gone and the parent's rename is already in state. Either way, please add a test.

Comment thread bundle/direct/dresources/adapter.go Outdated
Comment on lines 479 to 483
// A parent's rename also re-keys a resource through its provided_id_fields (see followsParentRename).
canUpdateWithID := hasUpdateWithIDTrigger || (a.resourceConfig != nil && len(a.resourceConfig.ProvidedIDFields) > 0)
if a.doUpdateWithID != nil && !canUpdateWithID {
return errors.New("DoUpdateWithID is implemented but resourceConfig lacks updatable_id_fields and provided_id_fields")
}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nice to have] This whole check runs only when a.overrideChangeDesc == nil (line 474). ResourceSecret implements OverrideChangeDesc for value, so the check never ran for secrets, before or after this change. I reverted these lines and go test ./bundle/direct/... plus the secret and rename_with_model_and_secret acceptance tests still pass. Every other resource with DoUpdateWithID and no OverrideChangeDesc already has updatable_id_fields.

So the only effect is that any resource with provided_id_fields (most of them) can now define a DoUpdateWithID that nothing calls. That is what this guard exists to catch, and AGENTS.md asks to avoid speculative flexibility. Please drop the hunk and the matching sentence in the description. If it should stay for future resources, also require IDFromState, as canFollowParentRename does, and add a unit test.

@andrewnester andrewnester left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No blocking findings from a full pass; I'll take a manual look at the direct changes before approving.

@denik
denik force-pushed the denik/secrets-parent-rename branch from b667ba5 to c2907e3 Compare November 16, 2026 13:24
# When READPLAN=1, "bundle deploy" is called as "bundle deploy --plan .databricks/plan.json".
# Normalize so both variants produce identical output.
[[Repls]]
Old = ' --plan .databricks/plan.json'

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

isn't it already handled by $(readplanarg)?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, readplanarg only expands to --plan .databricks/plan.json (or to nothing). These tests trace the deploy, so with READPLAN=1 the >>> [CLI] bundle deploy --plan .databricks/plan.json line would differ from the other variant; the Repl strips the flag so both variants share one output.txt. The other readplanarg tests do not trace their deploy, so they do not need it.

@denik
denik force-pushed the denik/secrets-parent-rename branch from c2907e3 to 6536422 Compare November 16, 2026 15:35
@denik
denik removed this pull request from stack #7411 November 17, 2026 11:23
@denik
denik added this pull request to stack #7719 November 17, 2026 11:23
@denik
denik force-pushed the denik/secrets-parent-rename branch 2 times, most recently from fe42ff4 to 1e1984e Compare November 17, 2026 13:07
denik and others added 16 commits November 17, 2026 14:32
UC moves a secret with its renamed parent, so the planner now re-keys it
(update_id, parent_renamed) instead of recreating it, which failed with
ALREADY_EXISTS. A secret cannot be renamed itself, so its DoUpdateWithID only
re-keys; the adapter check now accepts DoUpdateWithID for a resource whose
provided_id_fields a parent rename can change.

Co-authored-by: Isaac <no-reply@databricks.com>
Co-authored-by: Isaac <no-reply@databricks.com>
Co-authored-by: Isaac <no-reply@databricks.com>
Co-authored-by: Isaac <no-reply@databricks.com>
…t; drop duplicated test-server moves

Co-authored-by: Isaac <no-reply@databricks.com>
The recreate deletes the secret at its recorded path after the schema's rename
moved it, so the moved secret is left behind.

Co-authored-by: Isaac <no-reply@databricks.com>
Co-authored-by: Isaac <no-reply@databricks.com>
Co-authored-by: Isaac <no-reply@databricks.com>
Co-authored-by: Isaac <no-reply@databricks.com>
Co-authored-by: Isaac <no-reply@databricks.com>
…secret

Co-authored-by: Isaac <no-reply@databricks.com>
Co-authored-by: Isaac <no-reply@databricks.com>
…rets (review S3)

The check is skipped for resources that implement OverrideChangeDesc, as secrets do.

Co-authored-by: Isaac <no-reply@databricks.com>
Only parent_id_fields (catalog_name, schema_name, from #7718) follow a parent's rename, so a name that references a renamed schema's name recreates the secret instead of re-keying it to a path that does not exist.

Co-authored-by: Isaac <no-reply@databricks.com>
…ADY_EXISTS

Verified on AWS, Azure and GCP: "Secret '<full_name>' already exists".

Co-authored-by: Isaac <no-reply@databricks.com>
…adness, review G1)

Co-authored-by: Isaac <no-reply@databricks.com>
@denik
denik force-pushed the denik/secrets-parent-rename branch from 1e1984e to 66ba15f Compare November 17, 2026 13:32

@Sankalp-Mittal Sankalp-Mittal left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[AI Generated] Review by review-factory (Claude Opus 5.5 + Claude Fable 5.2, cross-verified). Only points the reviewers agreed on are posted.

trace $CLI bundle plan

title "The create fails: the secret is already there"
trace errcode $CLI bundle deploy

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[AI Generated] nit: This deploy is expected to fail with 409, and .agents/rules/testing.md asks for musterr rather than errcode when a failure is required. Can this be trace musterr $CLI bundle deploy?

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

DABs DABs related issues

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants